package com.ls.controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Auther: chenjun
 * @Date 2021年08月20日 6:26
 * @Description:
 * 抽象类的作用：降低接口实现类对接口实现过程的难度
 * 将接口中不需要使用的抽象方法交给抽象类进行完成
 * 这样接口实现类就只需要对接口需要的方法进行重写
 *
 * servlet接口:
 *     void init(ServletConfig var1) throws ServletException;
 *
 *     ServletConfig getServletConfig();
 *
 *     void service(ServletRequest var1, ServletResponse var2) throws ServletException, IOException;
 *
 *     String getServletInfo();
 *
 *     void destroy();
 *
 *     仅仅service有用
 */
public class FirstServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("GET调用");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("POST调用");
    }
}
